package com.education.mymediaplayer.ui.videoview;

import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;
import android.widget.MediaController;
import android.widget.VideoView;

import com.education.mymediaplayer.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class VideoPlayActivity extends AppCompatActivity {

    @BindView(R.id.button_start)
    Button buttonStart;
    @BindView(R.id.videoview)
    VideoView videoview;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video_play);
        ButterKnife.bind(this);
    }

    @OnClick(R.id.button_start)
    public void onClick() {
        videoview.setVideoURI(Uri.parse("http://flv2.bn.netease.com/videolib3/1606/22/pEjJU7735/HD/pEjJU7735-mobile.mp4"));
        videoview.setMediaController(new MediaController(this));
        videoview.start();
    }
}
